<template>
  <div class="course-new-container">
    <div class="header">
      <el-page-header @back="$router.back()" content="新增课程">
      </el-page-header>
      <el-button type="primary" @click="save">保存</el-button>
    </div>
    <create-or-edit ref="create" />
  </div>
</template>

<script lang="ts">
import Vue from 'vue'
import CreateOrEdit from './components/create-or-edit.vue'

export default Vue.extend({
  name: 'CourseNewIndex',
  components: {
    CreateOrEdit
  },
  methods: {
    save () {
      (this.$refs as any).create.handleSave()
    }
  }
})
</script>

<style lang="scss" scoped>
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
</style>
